

using System;
using System.Collections.Generic;
using System.Text;
using DataAccessLayer;
using EntityLayer;
using DataLayer;
using System.Data;
using InfraStructureLayer;

namespace BusinessLayer
{
	public class busArticleComments:BusinessBase
	{
		public busArticleComments() : base()
		{
		}
		#region  Code Factory Generated Methods
		public void DeleteArticleCommentsByArticleCommentId(entArticleComments parEntArticleComments)
		{
				DbConnector insDbConnector = new DbConnector();
			try
			{
				datArticleComments insDatArticleComments = new datArticleComments();
				insDatArticleComments.DeleteArticleCommentsByArticleCommentId(parEntArticleComments, insDbConnector);
			}
			catch (SFException ex)
			{
				this.ErrorMessage=ex.Message;
			}
		}
	
   
		#endregion
        public DataTable SelectArticleCommentsByArticleContentId(entArticleComments parEntArticleComments)
        {
            try
            {
                datArticleComments insDatArticleComments = new datArticleComments();
                DbConnector insDbConnector = new DbConnector();
                return insDatArticleComments.SelectArticleCommentsByArticleContentId(parEntArticleComments, insDbConnector);
            }
            catch (SFException ex)
            {
                this.ErrorMessage = ex.Message;
            }
            return null;
        }
        public void InsertArticleComments(entArticleComments parEntArticleComments)
		{
			datArticleComments insDatArticleComments=null;
				DbConnector insDbConnector = new DbConnector();
			try
			{
				insDatArticleComments = new datArticleComments();
				insDatArticleComments.InsertArticleComments(parEntArticleComments, insDbConnector);

                datArticleContents insDatArticleContents = new datArticleContents();
                entArticleContents insEntArticleContents = new entArticleContents();
                insEntArticleContents.ArticleContentId = parEntArticleComments.ArticleContentId;
                insDatArticleContents.SelectArticleContentsByArticleContentId(insEntArticleContents, insDbConnector);

                object[] mailParams = new object[] { insEntArticleContents.ArticleTitle, parEntArticleComments.ArticleCommentUserName, parEntArticleComments.ArticleCommentBody };
                busMails insBusMails = new busMails();
                insBusMails.SendMail(3, mailParams);
			}
			catch (SFException ex)
			{
				this.ErrorMessage=ex.Message;
			}
		}
	}
}